typedef enum { STATE_A, STATE_B } State;

void handle_state(State* current) {
    switch (*current) {
        case STATE_A:
            printf("State A\n");
            *current = STATE_B;
            break;
        case STATE_B:
            printf("State B\n");
            *current = STATE_A;
            break;
    }
}